import { createRouter, createWebHashHistory } from 'vue-router'
import userService from "./userService.js"
import bedService from "./bedService.js"
import nurseService from "./nurseService.js"
import foodService from "./foodService.js"
import nursePeople from "./nursePeople.js"
import userManage from "./userManage.js"
const routes = [
  {
    path: '/',
    name: 'Login',
    component: () => import('../views/LoginView.vue')
  },
  {
    path: '/managerHome',
    name: 'managerHome',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../layout/ManagerHome.vue'),
	children:[
	// 	{
	// 	path: '/dayservice',
	// 	name: 'dayservice',
	// 	component: () => import('../views/serviceman/dayservice.vue')
	// },
	...userService,
	...bedService,
	...nurseService,
	...foodService,
	...nursePeople,
	...userManage,
	]
  },
  {
    path: '/nurseHome',
    name: 'nurseHome',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../layout/NurseHome.vue'),
  	children:[
  	// 	{
  	// 	path: '/dayservice',
  	// 	name: 'dayservice',
  	// 	component: () => import('../views/serviceman/dayservice.vue')
  	// },
  	]
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
